//
//  Coupon.m
//  Truffle
//
//  Created by raca on 05/03/10.
//  Copyright 2010 isrtream1-svn . All rights reserved.
//

#import "Coupon.h"


@implementation Coupon


@synthesize idCoupon, name, descriptions, provider, position, couponCode;

- (void) dealloc {
	[idCoupon release];
	[name release];
	[position release];
	[provider release];
	[couponCode release];
	[descriptions release];
	[super dealloc];
} 



/*
 * Initialisation du coupon
 */
- initWithId:(NSString*)anId name:(NSString*)aName position:(NSString*)aPosition 
	provider:(NSString*)aProvider couponCode:(NSString*)aCouponCode descriptions:(NSString*)aDescription{
	self = [super init];
	if (self != nil) {
		[self setIdCoupon:anId];
		[self setName:aName];
		[self setProvider:aProvider];
		[self setPosition:aPosition];
		[self setCouponCode:aCouponCode];
		[self setDescriptions:aDescription];
	}
	return self;	
} 



- (NSString*) description {
	return [NSString stringWithFormat:@"Coupon :\n id : %@ \n name : %@ \n position : %@ \n provider : %@ \n couponCode : %@ \n descriptions : %@ \n",
			[self idCoupon],[self name],[self position],[self provider], [self couponCode], [self descriptions]];
}


@end
